#app {
  .main-container {
    min-height: 100%;
    transition: margin-left 0.28s;
    margin-left: $sideBarWidth;
    position: relative;
    z-index: 120;
  }

  .sidebar-container {
    transition: width 0.28s;
    width: $sideBarWidth !important;
    background: $sideBarBg;
    // background-size: 100% 100%;
    // background-size: cover;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 131;
    overflow: hidden;
    //导航分离
    &.multiple {
      margin-top: calc(#{$topBarHeight} + #{$topBarOutHeight});
      z-index: 110;
    }

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }
    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - #{$topBarHeight} - #{$topBarOutHeight} - 15px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 16px;
      height: 15px;
      width: 15px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
      background: $menuBg !important;
    }
    // menu hover
    .submenu-title-noDropdown,
    .el-submenu__title {
      height: $sideBarHeight;
      line-height: $sideBarHeight;
      // min-width: $sideBarWidth !important;
      background: $subMenuBg !important;
      &:before {
        content: '';
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 0;
        height: 0;
        box-sizing: border-box;
        transition: border-color 0s ease-out 0.3s, width 0s ease-out 0.3s,
          height 0.3s ease-out 0s;
      }
      // &:after {
      //   content: '';
      //   display: block;
      //   position: absolute;
      //   right: 0;
      //   bottom: 0;
      //   width: 0;
      //   height: 0;
      //   border: 5px solid transparent;
      //   box-sizing: border-box;
      //   transition: border-color 0s ease-out 0.4s, width 0.2s ease-out 0.2s,
      //     height 0.2s ease-out 0s;
      // }
      &:hover {
        background: $subMenuHover !important;
      }
    }
    .is-active.submenu-title-noDropdown {
      background: $subMenuActiveBg !important;
      // transition: border-right 0.3s ease-out 0s;
      // border-right: 5px solid $menuActiveTextColor;
      &:before {
        width: 100% !important;
        height: 100% !important;
        border: 5px solid transparent;
        border-right-color: $menuActiveTextColor;

        // background: $menuActiveTextColor;
        // transition: border-color 0s ease-out 0s, height 0.3s ease-out 0.3s,
        //   width 0.3s ease-out 0s, border 0s ease-out 0.3s;

        transition: border-color 0s ease-out 0s, height 0.3s ease-out 0s;
        z-index: 1;
      }
      // &:after {
      //   width: 100%;
      //   height: 100%;
      // }
    }
    // .el-submenu .el-submenu__title {
    //   &:before {
    //     content: '';
    //     display: block;
    //     position: absolute;
    //     left: 0;
    //     top: 0;
    //     width: 0;
    //     height: 0;
    //     box-sizing: border-box;
    //     transition: border-color 0s ease-out 0.3s, width 0s ease-out 0.3s,
    //       height 0.3s ease-out 0s;
    //   }
    // }

    .is-opened > .el-submenu__title {
      &:before {
        display: none !important;
      }
    }

    .is-active > .el-submenu__title {
      color: $subMenuActiveTextColor !important;
      &:before {
        width: 100% !important;
        height: 100% !important;
        border: 5px solid transparent;
        border-right-color: $menuActiveTextColor;
        transition: border-color 0s ease-out 0s, height 0.3s ease-out 0s;
        z-index: 1;
      }
    }

    & .nest-menu .el-submenu > .el-submenu__title,
    & .el-submenu .el-menu-item {
      height: $sideBarHeight;
      line-height: $sideBarHeight;
      min-width: $sideBarWidth !important;
      background: $subMenuBg !important;

      &:before {
        content: '';
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 0;
        height: 0;
        box-sizing: border-box;
        transition: border-color 0s ease-out 0.3s, width 0s ease-out 0.3s,
          height 0.3s ease-out 0s;
      }

      &:hover {
        background: $menuHover !important;
      }
      &.is-active {
        background: $menuActiveBg !important;
        &:before {
          width: 100% !important;
          height: 100% !important;
          border: 5px solid transparent;
          border-right-color: $menuActiveTextColor;
          transition: border-color 0s ease-out 0s, height 0.3s ease-out 0s;
          z-index: 1;
        }
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: $hideSidebarWidth !important;
    }

    .main-container {
      margin-left: $hideSidebarWidth;
    }
    .fixed-header {
      width: calc(100% - #{$hideSidebarWidth});
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      & > .el-submenu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        & > .el-submenu__title {
          & > span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-submenu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform 0.28s;
      width: $sideBarWidth !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  // background: $sideBarBg;
  & > .el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .nest-menu .el-submenu > .el-submenu__title,
  .el-menu-item {
    height: $sideBarHeight;
    line-height: $sideBarHeight;
    background: $sideBarBg;
    color: $menuTextColor;
    &:hover {
      // you can use $subMenuHover
      background: $menuHover !important;
    }
  }
  .el-menu-item {
    background: $sideBarBg !important;
    color: $menuTextColor !important;
    &:before {
      content: '';
      display: block;
      position: absolute;
      left: 0;
      top: 0;
      width: 0;
      height: 0;
      box-sizing: border-box;
      transition: border-color 0s ease-out 0.3s, width 0s ease-out 0.3s,
        height 0.3s ease-out 0s;
    }
    &.is-active {
      background: $menuActiveBg !important;
      &:before {
        width: 100% !important;
        height: 100% !important;
        border: 5px solid transparent;
        border-right-color: $menuActiveTextColor;
        transition: border-color 0s ease-out 0s, height 0.3s ease-out 0s;
        z-index: 1;
      }
    }
  }
  .el-submenu__title {
    background: $sideBarBg !important;
    color: $menuTextColor !important;
    &:before {
      content: '';
      display: block;
      position: absolute;
      left: 0;
      top: 0;
      width: 0;
      height: 0;
      box-sizing: border-box;
      transition: border-color 0s ease-out 0.3s, width 0s ease-out 0.3s,
        height 0.3s ease-out 0s;
    }
  }

  .is-opened > .el-submenu__title {
    &:before {
      display: none !important;
    }
  }

  .is-active > .el-submenu__title {
    color: $subMenuActiveTextColor !important;
    &:before {
      width: 100% !important;
      height: 100% !important;
      border: 5px solid transparent;
      border-right-color: $menuActiveTextColor;
      transition: border-color 0s ease-out 0s, height 0.3s ease-out 0s;
      z-index: 1;
    }
  }

  // the scroll bar appears when the subMenu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;
    padding: 0;
    background: $sideBarBg !important;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
